package com.huffman.smart_picture.domain.request.user;

import com.huffman.smart_picture.domain.entity.User;
import lombok.Data;

/**
 * @author DengLin
 * @title 用户信息更新体
 * @date 2024/07/03
 */
@Data
public class UserUpdateRequest {
    private Long id;

    private String username;

    private String password;

    private String avatar;

    private String phone;

    private String email;

    public static User convert(UserUpdateRequest userUpdateRequest) {
        User user = new User();
        user.setId(userUpdateRequest.getId());
        user.setUsername(userUpdateRequest.getUsername());
        user.setPassword(userUpdateRequest.getPassword());
        user.setAvatar(userUpdateRequest.getAvatar());
        user.setPhone(userUpdateRequest.getPhone());
        user.setEmail(userUpdateRequest.getEmail());
        return user;
    }
}
